/* 导航栏 */
.nav-button {
    position: fixed;
    right: 20px;
    top: 100px;
    padding: 10px 20px;
    background: #0366d6;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    z-index: 1000;
}

.right-toc {
    display: none;
    position: fixed;
    right: 20px;
    top: 150px;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 999;
    font-size: 15px;
}

.right-toc:hover {
    display: block;
}

.right-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-h2, .toc-h3 {
    margin: 3px 0;
}

.toc-h3 {
    padding-left: 15px;
}

.right-toc a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 4px 0;
}

.right-toc a:hover {
    color: #0366d6;
}


/* 设置内容最大显示区域 */
:root {
    --content-max-width: 1200px;
}


/* 设置文字大小 */
body, .hljs {
    font-size: 17px;
}
h2 {
    text-align: center;
    font-size: 27px;
    font-weight: bold;
}
h3 {
    font-size: 22px;
    font-weight: bold;
}
h2::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 70px;
  background-image: url('/cpython-internal/images/h2.webp');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}
h3::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background-image: url('/cpython-internal/images/h3.png');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 5px;
  vertical-align: middle;
}

/* h2 和 h3 标签点击之后不显示 >> */
h2:target::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 70px;
  background-image: url('/cpython-internal/images/h2.webp');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
  vertical-align: middle;
}
h3:target::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background-image: url('/cpython-internal/images/h3.png');
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 5px;
  vertical-align: middle;
}

/* h2 和 h3 标签，鼠标放上去变颜色 */
h2:hover, h3:hover {
  color: rgb(217, 33, 66);  /* 鼠标悬停时的颜色 */
}

/* 设置内容区域左右边距 */
.content main {
    margin-left: auto;
    margin-right: auto;
    max-width: var(--content-max-width);
    padding-right: 150px;
    padding-left: 70px;
}


/*代码高亮*/
.hljs-keyword{  /*关键字*/
    color: #EC099C;
    font-weight: bold;
}

.hljs-quote{  /*引号*/
    color: #017BCD;
    /* font-weight: bold; */
}

.hljs-number{ /*数值*/
    color: #9808F1;
    /* font-weight: bold; */
}

.hljs-string{ /*字符串*/
    color: #1812EF;
    /*font-weight: bold;*/
}

.hljs-built_in{ /*内置函数*/
    color: #D74907;
    /* font-weight: bold; */
}

.hljs-comment{  /*注释*/
    color: #008000;
}

.hljs-params {  /*参数*/
  color: #ae08c1;
  /* font-weight: bold; */
}

.hljs-class{  /*类冒号*/
   color: #03654D;
   /* font-weight: bold; */
}

.hljs-title{  /*类、方法函数*/
  color: #0783e8;
  /* font-weight: bold; */
}

.hljs-literal{  /*常量*/
  color: #8B0324;
  /* font-weight: bold; */
}

.hljs-string-interpolation, /* 用于 f-string */
.hljs-subst { /* 用于字符串插值 */
    color: #CB4D0E;
}